﻿using UnityEngine;

namespace SimWar.Scripts.Components.CameraGesture
{
    /// <summary>
    /// 触碰回调函数
    /// </summary>
    public interface IInput
    {
        // 开始回调函数，（按钮按下、触碰）触发一次
        void OnPointerDown(Vector2 pixelPosition);

        // 移动回调函数，移动时触发
        void OnPointerMove(Vector2 pixelPosition, Vector2 direction);

        // 缩放回调函数，缩放时触发
        void OnPointerZoom(Vector2 pixelPosition, float distance);

        // 结束回调函数，（按钮松开，触离）触发一次
        void OnPointerUp(Vector2 pixelPosition);

        // 更新回调函数，每侦触发
        void UpdatePointers();
    }

    public class IInputProvider
    {
        protected IInput mInput;
        public virtual Vector2 PointerPosition
        {
            get
            {
                return Vector2.zero;
            }
        }

        public IInputProvider(IInput input)
        {
            mInput = input;
        }
        public virtual void ProcessPointer()
        {

        }
    }
}